﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using FRL.DebtChased.Types;
using System.Xml.Serialization;
using FRL.DebtChased.Silverlight.Library;
using FRL.DebtChased.Extensions;
using System.Collections.ObjectModel;

namespace FRL.DebtChased.Silverlight.Library.RichContentService
{
    public partial class AccountInvoiceTransport
    {
        [XmlIgnore]
        public string StringAmount
        {
            get
            {
                return ((Money2)this.AmountField).ToString();
            }
            set
            {
                if (StringAmount != value)
                {
                    //                    try
                    {
                        Money2 money = (Money2)((string)value);
                        CurrencyTransport ct = (CurrencyTransport)money;
                        this.Amount = ct;
                    }
                    //catch (Exception ex)
                    //{
                    //    throw ex;
                    //}
                    this.RaisePropertyChanged("StringAmount");
                }
            }
        }
    }

    public partial class AccountNoteTransport
    {
        [XmlIgnore]
        public string CuteDate
        {
            get { return Timestamp.ToCuteString(); }
        }
    }

    public partial class ContactPointTransport
    {
        [XmlIgnore]
        private ObservableCollection<AccountNoteTransport> _notes;
        [XmlIgnore]
        public ObservableCollection<AccountNoteTransport> Notes
        {
            get { return _notes; }
            set
            {
                this._notes = value;
                this.RaisePropertyChanged("Notes");
            }
        }

    }



}
